package com.whh.nlp.mapper;

import com.whh.nlp.pojo.Dapei;
import com.whh.nlp.pojo.DapeiCount;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DapeiMapper {

    @Select("SELECT key_word1 as keyWord1, key_word2 as keyWord2, relation as relation, zuowen_id as zuowenId FROM dapei WHERE relation IN ('定中关系', '主谓关系', '动宾关系') AND (key_word1 = #{str} OR key_word2 = #{str})")
    List<Dapei> getDapei(String str);

    @Select("SELECT relation, count(*) AS `count` FROM dapei GROUP BY relation ORDER BY `count` DESC")
    List<DapeiCount> getDapeiCount();
}
